<?php
namespace app\admin\controller;
use think\Session;
use think\Controller;
use app\admin\model\Admin;
use think\Db;
class Base extends Controller
{
    /**
     *登录&&初始化数据
     */
    public function _initialize(){
         ini_set('date.timezone','Asia/Shanghai');//北京时区
        /* $isonline = Db::name('admin')->where('id','eq',Session::get('admin_id'))->field('isonline')->find(); */
        /*  if($isonline['isonline'] == 0) { */
        /*     Session::delete('admin_id'); */
        /*  } */
        if(!Session::get('admin_id')){
            $this->redirect('Login/index'); 
        }
        
         $admin = new Admin;
         $this->assign("adminInfo",$admin->adminInfo()); 
    }
}


